package com.dddpeter.app.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

import java.time.LocalDateTime;

@TableName("users")
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User {
    
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    
    @TableField("username")
    private String username;
    
    @TableField("email")
    private String email;
    
    @TableField("full_name")
    private String fullName;
    
    @TableField("password")
    private String password;
    
    @TableField("can_login")
    private Boolean canLogin = false;
    
    @TableField("is_admin")
    private Boolean isAdmin = false;
    
    @TableField(value = "created_at", fill = FieldFill.INSERT)
    private LocalDateTime createdAt;
    
    @TableField(value = "updated_at", fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updatedAt;
}
